<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2019/4/30
  Time: 10:36
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<c:set var="ctx" value="${pageContext.request.contextPath}"/>


<link rel="stylesheet" type="text/css" href="${ctx}/static1/layui/css/layui.css"></link>
<link rel="stylesheet" type="text/css" href="${ctx}/static1/easyui/themes/default/easyui.css"></link>
<link rel="stylesheet" type="text/css" href="${ctx}/static1/easyui/themes/icon.css"></link>
<script type="application/javascript" src="${ctx}/static1/jquery/jquery-3.2.1.min.js"></script>
<script type="application/javascript" src="${ctx}/static1/easyui/jquery.easyui.min.js"></script>
<script type="application/javascript" src="${ctx}/static1/jquery/jquery.serializejson.min.js"></script>
<script type="application/javascript" src="${ctx}/static1/layui/layui.all.js"></script>

<script>
    var ctx ="${ctx}"
    var easyUiPanelOnMove = function(left,top){
        if(left<0){
            $(this).window('move',{
               left:1
            });
        }
        if(top<0){
            $(this).window('move',{
                top:1
            });
        }
        var width = parseInt($(this).parent().css('width'));
        var heigth = parseInt($(this).parent().css('height'));
        var parentWidth = $(window).width();
        var parentHeight = $(window).height();
        if(left>parentWidth-width){
            $(this).window('move',{
                "left":parentWidth-width
            });
        }
        if(top>parentHeight-heigth){
            $(this).window('move',{
               "top":parentHeight-heigth
            });
        }
    }
    $.fn.panel.defaults.onMove =easyUiPanelOnMove;
    $.fn.window.defaults.onMove = easyUiPanelOnMove;
    $.fn.dialog.defaults.onMove = easyUiPanelOnMove;
</script>